﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/FrontSite.Master" Inherits="System.Web.Mvc.ViewPage" Title="前台首页" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    采气井单井月曲线
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
    

    <h1 style="text-align: center">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;采气井单井月曲线</h1>
    
    <link href="../../Scripts/Ext4_2/resources/css/ext-all.css" rel="stylesheet" />
    <script src="../../Scripts/Ext4_2/resources/ext-all.js"></script>
    <script src="../../Curves/CQJMonthCurve.js"></script>
    <script src="../../Curves/CQJLine.js"></script>
    <script src="../../Content/My97DatePicker/WdatePicker.js"></script>
    <link href="../../Content/sideBar.css" rel="stylesheet" />
    <script>
        //设置当前导航栏的样式为“已点击”
        jQuery(document).ready(function ($) {
            $('#lnkbtnSingleWellMonthCurve').css("color", "red");
        })

        //刷新“btnLogin”为“btnLogout”
        $(document).ready(function () {
            document.getElementById("btnLogin").text = "退出";
        });

        $(document).ready(function () {
            //点击“查询”按钮后进行刷新
            $("#queryBtn").click(function () {
                //得到参数
                var JHSelect = $('#JHSelect option:selected').val();
                var productdate_box = $("#MainContentPlaceHolder_productdate_box").val();
                //更新store1
                store1.load({
                    params: { JHSelect: JHSelect, productdate_box: productdate_box },
                    url: 'CQJMonthCurveQuery',
                    method: 'POST',
                    success: function (sesponseTest) {
                        alert(sesponseTest);
                    },
                    failure: function (data) {
                    }
                });
            });
        });

        //设置select菜单的ajax联动效果
        //根据WorkZoneSelect菜单的选值获取当前作业区下的生产大队列表
        $(function () {
            //先去获取“第一作业区”下的所有“采油大队”
            $.ajax({
                url: "CQDDSelect?workZoneSelectValue=第一作业区",
                type: 'get',
                dataType: 'JSON',
                timeout: 5000,
                success: function (data) {
                    $("#CQDDSelect").empty();
                    $.each(eval(data), function (i, item) {
                        $("<option value='" + item.name + "'>" + item.value + "</option>").appendTo($("#CQDDSelect"));
                    });
                }
            });

            window.CQDDSelectValue = '';
            window.CQXDSelectValue = '';

            $("#WorkZoneSelect").change(function () {
                //先获取WorkZoneSelect菜单的当前选值
                var workZoneSelectValue = $('#WorkZoneSelect option:selected').val();
                //再把这个值传到后台去
                $.ajax({
                    url: "CQJ_CQDDSelect?workZoneSelectValue=" + workZoneSelectValue,
                    type: 'get',
                    dataType: 'JSON',
                    timeout: 5000,
                    success: function (data) {
                        $("#CQDDSelect").empty();
                        $.each(eval(data), function (i, item) {
                            if (i = '0') {
                                CQDDSelectValue = item.value;
                                $.ajax({
                                    url: "CQJ_SCXDSelect?CQDDSelectValue=" + CQDDSelectValue,
                                    type: 'get',
                                    dataType: 'JSON',
                                    timeout: 5000,
                                    success: function (data) {
                                        $("#CQXDSelect").empty();
                                        $.each(eval(data), function (i, item) {
                                            CQXDSelectValue = item.value;
                                            $.ajax({
                                                url: "CQJ_JHSelect?CQXDSelectValue=" + CQXDSelectValue,
                                                type: 'get',
                                                dataType: 'JSON',
                                                timeout: 5000,
                                                success: function (data) {
                                                    $("#JHSelect").empty();
                                                    $.each(eval(data), function (i, item) {
                                                        $("<option value='" + item.name + "'>" + item.value + "</option>").appendTo($("#JHSelect"));
                                                    });
                                                }
                                            });
                                            $("<option value='" + item.name + "'>" + item.value + "</option>").appendTo($("#CQXDSelect"));
                                        });
                                    }
                                });
                            }
                            $("<option value='" + item.name + "'>" + item.value + "</option>").appendTo($("#CQDDSelect"));
                        });
                    }
                });
            });

            //当采油井类型改变时改变“井号”的列表项
            $("#JXSelect").change(function () {
                var CQDDSelectValue = $('#CQDDSelect option:selected').val();
                //先获取JXSelect菜单的当前选值
                var JXSelectValue = $('#JXSelect option:selected').val();
                //再把这个值传到后台去
                $.ajax({
                    url: "JHSelect?strSCDD=" + CQDDSelectValue + "&strJX=" + JXSelectValue,
                    type: 'get',
                    dataType: 'JSON',
                    timeout: 5000,
                    //error: function() {alert('加载数据异常，请重试!');},
                    success: function (data) {
                        $("#JHSelect").empty();
                        $.each(eval(data), function (i, item) {
                            $("<option value='" + item.name + "'>" + item.value + "</option>").appendTo($("#JHSelect"));
                        });
                    }
                });
            });
        });
    </script>

    <br />
    <p class="auto-style5">
         &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;工作区：<select id="WorkZoneSelect" name="D1">
            <option>第一作业区</option>
            <option>第二作业区</option>
            <option>第三作业区</option>
        </select>
        &nbsp;&nbsp;&nbsp; 采气大队：<select id="CQDDSelect" name="D2">
            <option>第一采气大队</option>
        </select>
        &nbsp;&nbsp;&nbsp; 采气小队：<select id="CQXDSelect" name="D3">
            <option>第一采气小队</option>
        </select>&nbsp;&nbsp;&nbsp; 井号：<select id="JHSelect" name="D4">
            <option>CQJ_1_1_1_1</option>
        </select>
        &nbsp;&nbsp;&nbsp;&nbsp; 生产年月：
        <input id="productdate_box" runat="server" class="Wdate" value="2014-09" onclick="WdatePicker({ dateFmt: 'yyyy-MM' })" type="text" style="width: 100px" />&nbsp;&nbsp;&nbsp;
        <input type="button" id="queryBtn" value="查询"/>
    </p>


    <div id="curveDiv" style="text-align: center">
    </div>
    <br />

    <ul id="dock">
        <br /><br /><br /><br /><br /><br /><br /><br /><br />
        <li id="links" onclick="location='CYJMonthCurve'">
        </li>
        <li id="files" onclick="location='ZSJMonthCurve'">
        </li>
        <li id="tools" onclick="location='CQJMonthCurve'">
        </li>
    </ul>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="head" runat="server">
</asp:Content>
